<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>关键字列表</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style media="screen">
        html,
        body {
            background: #fff;
        }

        .wrap {
            width: 100%;
            padding: 0 15px;
            overflow: hidden;
            box-sizing: border-box;
        }

        .wrap ul {
            width: 100%;
            overflow: hidden;
        }

        .wrap ul li {
            width: 100%;
            padding: 10px 0;
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 400;
            color: #333333;
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0, #EEEEEE, #EEEEEE 50%, transparent 50%);
            background-image: -webkit-linear-gradient(90deg, #EEEEEE, #EEEEEE 50%, transparent 50%);
            overflow: hidden;
        }
        [v-cloak] {
            display: none!important;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="wrap">
            <ul>
                <li @click='searchEvent(item.kw)' v-for='item in LenovoWordList'>{{item.kw}}</li>
            </ul>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {
        vm.getLenovoWord()
    }
    var vm = new Vue({
        el: '#app',
        data: {
            LenovoWordList: []
        },
        methods: {
            getLenovoWord: function() {
                api.ajax({
                    url: cl.apiServer + 'tb/searchSuggestion?keyWords=' + api.pageParam.keyword,
                    method: 'post',
                    headers: {
                        token:cl.userToken
                    }
                }, function(ret, err) {
                    if (ret) {
                        if (ret.code == 0) {
                            vm.LenovoWordList = ret.data;
                        }
                    }
                })
            },
            searchEvent: function(keyWord) {
                cl.closeFrame({
                    name: 'search_keyword_list_frame'
                })
                api.sendEvent({
                    name: 'searchEvent',
                    extra: {
                        keyWord: keyWord
                    }
                });

            }
        }
    });
</script>

</html>
